home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
src
/
haeberli
/
impression
/
ssshow.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-01
|
2KB
|
115 lines
/*
* Copyright 1991, 1992, 1993, 1994, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
/*
* ssshow -
* Display a sample set on the screen.
*
* Paul Haeberli - 1988
*
*/
#include "stdio.h"
#include "gl.h"
#include "device.h"
#include "ss.h"
#include "math.h"
#include "image.h"
#define NSTYLES 13
int styles[NSTYLES] = {
CIRCLES,
MULTILINE,
SQUARES,
STROKES,
LONGSTROKES,
LINES,
SCATTER,
LONGSCATTER,
SCATTERPOLY,
CONE,
FINELINES,
ONELINE,
NEEDLEPOINT,
};
long xsize, ysize;
float addrot;
sampleset *ss;
main(argc,argv)
int argc;
char **argv;
{
int i, j;
short val;
if( argc<2 ) {
fprintf(stderr,"usage: ssshow infile [-m]\n");
exit(1);
}
winopen("ssshow");
pseudorgb();
subpixel(1);
ss = ssfromfile(argv[1]);
qmouse();
makeframe();
savergbwindow("blat.rgb");
j = 0;
while(1) {
switch(qread(&val)) {
case LEFTMOUSE:
if(val) {
j++;
if(j>=NSTYLES)
j = 0;
ssset(ss,styles[j]);
makeframe();
}
break;
case REDRAW:
makeframe();
break;
}
}
}
makeframe()
{
getsize(&xsize,&ysize);
reshapeviewport();
grey(0.5);
clear();
zbuffer(1);
zclear();
ssortho(xsize,ysize);
ssdraw(ss);
}
ssset(iss,val)
sampleset *iss;
int val;
{
sample *s;
s = iss->head;
while(s) {
s->SAMPLE_SHAPE = val;
s = s->next;
}
}